class CategorysModel {
// {
//     "errorCode": 0,
//     "errorMsg": ""
// }

  final Categorys? data;
  final num? errorCode;
  final String? errorMsg;

  CategorysModel({
    this.data,
    this.errorCode,
    this.errorMsg,
  });

  factory CategorysModel.fromJson(Map<String, dynamic> json) {
    return CategorysModel(
      data: json['data'] == null ? null : Categorys.fromJson(json['data']),
      errorCode: json['errorCode'],
      errorMsg: json['errorMsg'],
    );
  }

  Map<String, dynamic> toJson() => {
        'data': data?.toJson(),
        'errorCode': errorCode,
        'errorMsg': errorMsg,
      };
}

class Categorys {
// {
//     "curPage": 2,
//     "offset": 20,
//     "over": false,
//     "pageCount": 813,
//     "size": 20,
//     "total": 16248
// }

  final num? curPage;
  final List<Category>? datas;
  final num? offset;
  final bool? over;
  final num? pageCount;
  final num? size;
  final num? total;

  Categorys({
    this.curPage,
    this.datas,
    this.offset,
    this.over,
    this.pageCount,
    this.size,
    this.total,
  });

  factory Categorys.fromJson(Map<String, dynamic> json) {
    return Categorys(
      curPage: json['curPage'],
      datas: json['datas'] == null
          ? null
          : List<Category>.from(json['datas'].map((x) => Category.fromJson(x))),
      offset: json['offset'],
      over: json['over'],
      pageCount: json['pageCount'],
      size: json['size'],
      total: json['total'],
    );
  }

  Map<String, dynamic> toJson() => {
        'curPage': curPage,
        'datas': datas?.map((e) => e.toJson()).toList(),
        'offset': offset,
        'over': over,
        'pageCount': pageCount,
        'size': size,
        'total': total,
      };
}

class Category {
// {
//     "adminAdd": false,
//     "apkLink": "",
//     "audit": 1,
//     "author": "",
//     "canEdit": false,
//     "chapterId": 502,
//     "chapterName": "自助",
//     "collect": false,
//     "courseId": 13,
//     "desc": "",
//     "descMd": "",
//     "envelopePic": "",
//     "fresh": false,
//     "host": "",
//     "id": 30811,
//     "isAdminAdd": false,
//     "link": "https://mp.weixin.qq.com/s/15VuaAn7opHb7J1R_OcyUg",
//     "niceDate": "2025-09-17 09:43",
//     "niceShareDate": "2025-09-17 09:43",
//     "origin": "",
//     "prefix": "",
//     "projectLink": "",
//     "publishTime": 1758073397000,
//     "realSuperChapterId": 493,
//     "selfVisible": 0,
//     "shareDate": 1758073397000,
//     "shareUser": "鸿蒙开发笔记分享",
//     "superChapterId": 494,
//     "superChapterName": "广场Tab",
//     "tags": [],
//     "title": "鸿蒙Next实现歌词颜色渐变播放暂停",
//     "type": 0,
//     "userId": 6544,
//     "visible": 1,
//     "zan": 0
// }

  final bool? adminAdd;
  final String? apkLink;
  final num? audit;
  final String? author;
  final bool? canEdit;
  final num? chapterId;
  final String? chapterName;
  final bool? collect;
  final num? courseId;
  final String? desc;
  final String? descMd;
  final String? envelopePic;
  final bool? fresh;
  final String? host;
  final num? id;
  final bool? isAdminAdd;
  final String? link;
  final String? niceDate;
  final String? niceShareDate;
  final String? origin;
  final String? prefix;
  final String? projectLink;
  final num? realSuperChapterId;
  final num? selfVisible;
  final String? shareUser;
  final num? superChapterId;
  final String? superChapterName;
  final List? tags;
  final String? title;
  final num? type;
  final num? userId;
  final num? visible;
  final num? zan;

  Category({
    this.adminAdd,
    this.apkLink,
    this.audit,
    this.author,
    this.canEdit,
    this.chapterId,
    this.chapterName,
    this.collect,
    this.courseId,
    this.desc,
    this.descMd,
    this.envelopePic,
    this.fresh,
    this.host,
    this.id,
    this.isAdminAdd,
    this.link,
    this.niceDate,
    this.niceShareDate,
    this.origin,
    this.prefix,
    this.projectLink,
    this.realSuperChapterId,
    this.selfVisible,
    this.shareUser,
    this.superChapterId,
    this.superChapterName,
    this.tags,
    this.title,
    this.type,
    this.userId,
    this.visible,
    this.zan,
  });

  factory Category.fromJson(Map<String, dynamic> json) {
    return Category(
      adminAdd: json['adminAdd'],
      apkLink: json['apkLink'],
      audit: json['audit'],
      author: json['author'],
      canEdit: json['canEdit'],
      chapterId: json['chapterId'],
      chapterName: json['chapterName'],
      collect: json['collect'],
      courseId: json['courseId'],
      desc: json['desc'],
      descMd: json['descMd'],
      envelopePic: json['envelopePic'],
      fresh: json['fresh'],
      host: json['host'],
      id: json['id'],
      isAdminAdd: json['isAdminAdd'],
      link: json['link'],
      niceDate: json['niceDate'],
      niceShareDate: json['niceShareDate'],
      origin: json['origin'],
      prefix: json['prefix'],
      projectLink: json['projectLink'],
      realSuperChapterId: json['realSuperChapterId'],
      selfVisible: json['selfVisible'],
      shareUser: json['shareUser'],
      superChapterId: json['superChapterId'],
      superChapterName: json['superChapterName'],
      tags: json['tags'],
      title: json['title'],
      type: json['type'],
      userId: json['userId'],
      visible: json['visible'],
      zan: json['zan'],
    );
  }

  Map<String, dynamic> toJson() => {
        'adminAdd': adminAdd,
        'apkLink': apkLink,
        'audit': audit,
        'author': author,
        'canEdit': canEdit,
        'chapterId': chapterId,
        'chapterName': chapterName,
        'collect': collect,
        'courseId': courseId,
        'desc': desc,
        'descMd': descMd,
        'envelopePic': envelopePic,
        'fresh': fresh,
        'host': host,
        'id': id,
        'isAdminAdd': isAdminAdd,
        'link': link,
        'niceDate': niceDate,
        'niceShareDate': niceShareDate,
        'origin': origin,
        'prefix': prefix,
        'projectLink': projectLink,
        'realSuperChapterId': realSuperChapterId,
        'selfVisible': selfVisible,
        'shareUser': shareUser,
        'superChapterId': superChapterId,
        'superChapterName': superChapterName,
        'tags': tags,
        'title': title,
        'type': type,
        'userId': userId,
        'visible': visible,
        'zan': zan,
      };
}
